<!--
 * @Author: your name
 * @Date: 2021-11-12 14:04:15
 * @LastEditTime: 2021-11-12 14:07:41
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \vue-note\day02\07.v-if和v-show.html
-->
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>07.v-if和v-show</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.14/vue.js"></script>
  </head>
  <body>
     <div id="app">
         <!-- - `v-if`：根据表达式的值的真假条件，销毁或重建元素 -->
         <!-- - `v-show`：根据表达式之真假值，切换元素的 display CSS 属性 -->
       <p v-if='isShow'>{{msg}}</p>
       <p v-show='isShow'>{{msg}}</p>
       <button @click='show(true)'>显示</button>
       <button @click='hidden'>隐藏</button>
     </div>
     </div>
     </div>
     <script>
       new Vue({
         el: "#app",
         data: {
           msg: 'hello',
           isShow: false
         },
         methods:{

         }
       });
     </script> 
  </body>
</html>
